
$.fn.bindFocus = function() {
    $(this).bind('focus', function() {
        $(this).parent().parent().find('.input-label').html('');
        $(this).parent().removeClass('error');
    });
};
// 验证email
function checkEmail(email) {
    email = $.trim(email);
    if (!email || email.length <= 0) {
        return '请填写Email！';
    }
    var patten = /^[\w\.-]+(\.\w+)*@(\w)+((\.\w+)+)$/;
    if (!patten.test(email)) {
        return '请输入正确的Email！';
    }
    return true;
}
//验证手机号码
function checkPhone(phone) {
    phone = $.trim(phone);
    if (!phone || phone.length <= 0) {
        return '请填写手机号码！';
    }
    var patten = /^\d{11}$/;
    if (!patten.test(phone)) {
        return '请填写正确的手机号码！';
    }
    return true;
}
//验证真实姓名
function checkTrueName(trueName) {
    trueName = $.trim(trueName);
    if (!trueName || trueName.length <= 0) {
        return '请填写真实姓名！';
    }
    var patten = /^.{2,12}$/;
    if (!patten.test(trueName)) {
        return '请填写正确的真实姓名！';
    }
    return true;
}
//验证密码
function checkPassword(password) {
    if (!password || password.length <= 0) {
        return '请填写密码！';
    }
    if (!/^.{6,24}$/.test(password)) {
        return '请输入6至24位密码！';
    }
    return true;
}

//验证密码
function checkVerify(verify) {
    if (!verify || verify.length != 6) {
        return '请填写正确的验证码！';
    }
    return true;
}